import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 小梅就是酱子
 * Date: 2022-02-04
 * Time: 16:24
 */
public class 数组逆序 {
    public static void main(String[] args) {
        int[] array={1,2,3,4,5,6};
        opp(array);
        System.out.println(Arrays.toString(array));
    }
    public static void opp(int[] array){
        int left=0;
        int right= array.length-1;
        while(left<right){
            int tmp=array[left];
            array[left]=array[right];
            array[right]=tmp;
            left++;
            right--;
        }
    }
}
